package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo2 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        map.put("a", 1);
        map.put("b", 2);
        map.put("c", 3);
        map.put("d", 4);
        map.put("e", 5);
        System.out.println(map);

        Integer value = map.get("a");
        System.out.println(value);

        value = map.get("n");
        System.out.println(value);

        System.out.println(map.size());
        System.out.println(map.isEmpty());


        System.out.println(map.containsKey("a"));
        System.out.println(map.containsValue(1));

        map.remove("a");
        System.out.println(map);

        value = map.remove("b");
        System.out.println(value);
        System.out.println(map);

        map.clear();
        System.out.println(map);
    }
}
